package collectionday02exercise;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class SublistDemo {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        Random random = new Random();
        for (int i = 0; i < 10; i++) {
            list.add(random.nextInt(100));
        }
        System.out.println(list);

        List<Integer> subList = list.subList(3,8);
        System.out.println(subList);
        for (int i = 0; i < subList.size(); i++) {
            subList.set(i,subList.get(i)*10);
        }
        System.out.println(subList);
        System.out.println(list);
        for (int i = 0; i < list.size(); i++) {
            list.set(i,list.get(i)/10);
        }
        System.out.println(subList);
        System.out.println(list);

        list.remove(3);
        System.out.println(list);
       // System.out.println(subList);
    }
}
